import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
// import "./utils/index";
import "../src/assets/font/iconfont.css";
const VueCookies = require("vue-cookies");
const echarts = require("echarts");
import moment from "moment";
import { Loading } from "element-ui";
import { setWaterMark, removeWatermark } from "@/utils/watermark";
import axios from "axios";
import JsonExcel from "vue-json-excel";
Vue.component("downloadExcel", JsonExcel);
// import "./utils/rem";
Vue.prototype.$echarts = echarts;
Vue.prototype.$moment = moment;
Vue.prototype.$VueCookies = VueCookies;
Vue.prototype.$Loading = Loading;
Vue.prototype.$http = axios;

// import * as echarts from "echarts";
// Vue.use(echarts);
Vue.use(VueCookies);
Vue.use(ElementUI);
Vue.use(moment);
Vue.config.productionTip = false;
router.afterEach((item) => {
  // console.log(item.name);
  if (item.name !== "Login") {
    const IP = window.localStorage.getItem("ip");
    const name = JSON.parse(window.localStorage.getItem("userInfo")).user
      .user_name;
    setWaterMark(IP, name);
  } else {
    removeWatermark();
  }
});
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
